package com.bpf.base.base.service.impl;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import com.bpf.base.base.dao.BaseMapper;
import com.bpf.base.base.service.BaseService;

public abstract class BaseServiceImpl<T, PK extends Serializable> implements
		BaseService<T, PK> {

	protected BaseMapper<T, PK> mapper;

	@Override
	public int countByExample(Object example) {
		return mapper.countByExample(example);
	}

	@Override
	public int deleteByExample(Object example) {
		return mapper.deleteByExample(example);
	}

	@Override
	public int deleteByPrimaryKey(PK pk) {
		return mapper.deleteByPrimaryKey(pk);
	}

	@Override
	public int insert(T record) {
		return mapper.insert(record);
	}

	@Override
	public int insertSelective(T record) {
		return mapper.insertSelective(record);
	}

	@Override
	public List<T> selectByExample(Object example) {
		return mapper.selectByExample(example);
	}

	@Override
	public T selectByPrimaryKey(PK pk) {
		return mapper.selectByPrimaryKey(pk);
	}

	@Override
	public int updateByExampleSelective(T record, Object example) {
		return mapper.updateByExampleSelective(record, example);
	}

	@Override
	public int updateByExample(T record, Object example) {
		return mapper.updateByExample(record, example);
	}

	@Override
	public int updateByPrimaryKeySelective(T record) {
		return mapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(T record) {
		return mapper.updateByPrimaryKey(record);
	}

	public List<T> selectList(Map<String, Object> conditions) {
		return mapper.selectList(conditions);

	}

	public int selectCount(Map<String, Object> conditions) {
		return mapper.selectCount(conditions);

	}

}
